<?phpsession_start();include_once('config/db_conn.php');include_once('db_config/db_user.php');include_once('db_config/db_gigs.php');include_once('db_config/db_sentmail.php');include_once('db_config/db_inbox.php');include_once('db_config/db_websetting.php');
$websetting= new websetting();$websetting_id = '1';$rs_websetting=$websetting->uniq_websettings('websetting_id',$websetting_id);$data_websetting=mysql_fetch_array($rs_websetting);
$sentmail=new sentmail();$inboxmail=new inbox();$mailid = @base64_decode($_REQUEST['id']);if($mailid<=0)reDirect('messages.php');$mailinfo = mysql_fetch_assoc($sentmail->uniq_sentmail_list('id',$mailid));$inboxmail->updateInfo(array('read_status'=>'Y'),$mailid);$user=new user();$rs_user_from=$user->uniq_user_list('user_id',$mailinfo['from_id']);$data_user_from=mysql_fetch_array($rs_user_from);$rs_user_to=$user->uniq_user_list('user_id',$mailinfo['to_id']);$data_user_to=mysql_fetch_array($rs_user_to);
$gigs_obj=new gigs();$rs_gigs=$gigs_obj->uniq_gigs_list('id',$mailinfo['gigs_id']);$data_gigs=mysql_fetch_array($rs_gigs);?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /><title><?php echo $data_websetting['change_title']; ?></title><link href="css/style.css" rel="stylesheet" type="text/css" /><script type="text/javascript" src="javascript/jquery.min.js"></script><script type="text/javascript" src="javascript/jquery.simplemodal.js"></script><script type="text/javascript" src="javascript/init.js"></script><script type="text/javascript" src="javascript/init1.js"></script><link type='text/css' href='css/stylesheet.css' rel='stylesheet' media='screen' /><link type='text/css' href='css/basic.css' rel='stylesheet' media='screen' />
<style type="text/css"><!--
.style2 {color: #2791B9}
.style3 {color: #000000}
--></style></head>
<body ><div id="container"><!--HEADER AREA--><?php include('header.php')?>  <!--HEADER AREA END-->  <div class="body_cont">
    <div class="body_cont_top"> </div>
    <div class="body_cont_center">
      <div class="left_cont">
        <div class="tweet_bx">
          <form method="post" id="edit_user" enctype="multipart/form-data"  action="">
            <table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr height="40">
                <td width="2%">&nbsp;</td>
                <td colspan="2"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                      <td width="80%">&nbsp;</td>
                      <td width="20%"><a href="messages.php?mailbox=inbox"><span class="style2"><strong>Inbox</strong> </span></a></td>
                    </tr>
                    <tr>
                      <td>&nbsp;</td>
                      <td><a href="messages.php?mailbox=sent"><span class="style2"><strong>Sent Items</strong></span></a></td>
                    </tr>					<?php if($_REQUEST['type']=="inbox"){ ?>                    <tr>
                      <td>&nbsp;</td>
                      <td><a href="new_messages.php?gig_id=<?=$mailinfo['gigs_id'];?>&to=<?=$data_user_from['user_name'];?>"><span class="style2"><strong>Reply</strong></span></a></td>
                    </tr>					<?php 	} ?>
                  </table></td>
              </tr>
              <tr height="40">
                <td>&nbsp;</td>
                <td width="11%" height="13"><strong>From</strong>:</td>
                <td width="87%"><?php echo $data_user_from['user_name']; ?></td>
              </tr>
              <tr height="40">
                <td>&nbsp;</td>
                <td height="17"><strong>To</strong>:</td>
                <td><?php echo str_replace(' ','-', $data_gigs['gigs_title']);?>				:: <?php echo $data_user_to['user_name']; ?>				</td>
              </tr>
              <tr height="40">
                <td>&nbsp;</td>
                <td height="13"><strong>Gig</strong>:</td>
                <td><a href="users_<?php echo $to;?>_gigs_<?php  echo str_replace(' ','-', $data_gigs['gigs_title']);?>"><?php echo $data_gigs['gigs_title']; ?></a></td>
              </tr>
            </table>
            <table width="100%" border="0" cellspacing="0" cellpadding="0" class="settings-form" bgcolor="#EFFAFF" >
              <tr height="40">
                <td width="1%">&nbsp;</td>
                <td width="19%"><strong>Subject</strong></td>
                <td width="80%"><?php echo $mailinfo['sub']; ?></td>
              </tr>
              <tr height="200">
                <td width="1%">&nbsp;</td>
                <td><strong>Message</strong></td>
                <td style="padding-left:6px;">

                <textarea style="width: 500px; height: 300px; border: 1px solid rgb(193, 123, 33);" name="textarea"><?php echo $mailinfo['body'];?></textarea>

                </td>
              </tr>
              <tr height="40">
                <td width="1%">&nbsp;</td>
                <td colspan="2">&nbsp;</td>
              </tr>							  <?php if($_REQUEST['type']=="inbox"){ ?>
              <tr height="40">
                <td width="1%">&nbsp;</td>
                <td colspan="2" align="right"><a href="new_messages.php?gig_id=<?=$mailinfo['gigs_id'];?>&to=<?=$data_user_from['user_name'];?>">Reply</a></td>              </tr>			  <?php } ?>
              <tr height="40">
                <td width="1%">&nbsp;</td>
                <td>&nbsp;</td>
                <td align="right">&nbsp;</td>
              </tr>
            </table>
          </form>
        </div>
      </div>
      <?php include('right.php'); ?>
    </div>
    <div class="body_cont_bottom"> </div>
  </div>
  <?php
include('footer.php');
 ?>
</div>
</body>
</html>